<?php
namespace app\index\controller;
use think\facade\View;
class Index
{
    public function index()
    {
        $timestamp = '?v=' . time();
        $is_we7 = defined('IS_WEIQIN') ? true : false;
        $appcss = $is_we7 ? '/addons/'. APP_MODEL_NAME .'/core2/public/static/css/app.css' : '/static/css/app.css';
        $manifest = $is_we7 ? '/addons/'.APP_MODEL_NAME.'/core2/public/static/js/manifest.js' : '/static/js/manifest.js';
        $vendor =  $is_we7 ?  '/addons/'.APP_MODEL_NAME.'/core2/public/static/js/vendor.js' : '/static/js/vendor.js';
        $app = $is_we7 ? '/addons/'.APP_MODEL_NAME .'/core2/public/static/js/app.js' : '/static/js/app.js';
        $jsPath = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/' : '/';
        $jquery = $is_we7 ? '/addons/'.APP_MODEL_NAME.'/core2/public/js/jquery-3.5.1.min.js' : '/js/jquery-3.5.1.min.js';
        global  $_W;
        $is_founder = isset($_W['isfounder']) ? $_W['isfounder'] : false;

        View::assign('jsPath', $jsPath);
        View::assign('jquery', $jquery .$timestamp);
        View::assign('is_founder', $is_founder);
        View::assign('isWe7', $is_we7);
        View::assign('appcss', $appcss.$timestamp);
        View::assign('manifest', $manifest .$timestamp);
        View::assign('vendor', $vendor .$timestamp );
        View::assign('app', $app . $timestamp);

        //var_dump(View());die;
        return View::fetch();
        // return View::engine('think')->fetch('index');
    }


    public function getCity(){
        echo '{
	"data": [{
		"id": 0,
		"title": "未定位",
		"lat": "31.354903596999",
		"lng": "118.87910842896",
		"city_type": 1,
		"top": 99,
		"distance": 1838895.80
	},
	{
		"id": 10,
		"title": "南京市",
		"lat": "31.354903596999",
		"lng": "118.87910842896",
		"city_type": 1,
		"top": 10,
		"distance": 1738895.8910664113
	}, {
		"id": 9,
		"title": "自贡市",
		"lat": "29.36371",
		"lng": "104.7739",
		"city_type": 1,
		"top": 9,
		"distance": 2641185.7829646263
	}, {
		"id": 7,
		"title": "成都市",
		"lat": "30.65984",
		"lng": "104.10194",
		"city_type": 1,
		"top": 7,
		"distance": 2576299.452494277
	}, {
		"id": 5,
		"title": "合肥市",
		"lat": "31.79322",
		"lng": "117.30794",
		"city_type": 1,
		"top": 5,
		"distance": 1751262.0134264224
	}, {
		"id": 3,
		"title": "北京市",
		"lat": "40.22077",
		"lng": "116.23128",
		"city_type": 1,
		"top": 3,
		"distance": 1048577.4020159615
	}, {
		"id": 1,
		"title": "上海市",
		"lat": "31.40527",
		"lng": "121.48941",
		"city_type": 1,
		"top": 1,
		"distance": 1659320.8587934768
	}],
	"code": 200,
	"sign": null,
	"return_code": "SUCCESS",
	"return_msg": "OK"
}';
    }


}
